# coding=utf-8
import uuid
import django
from datetime import datetime
from django.db import models

# Create your models here.


class Consumer(models.Model):
    id = models.UUIDField("编号", primary_key=True, default=uuid.uuid4, editable=False)
    name = models.CharField("名称", max_length=100, null=False, blank=True)
    phone = models.CharField("手机号", max_length=20, null=False, blank=True)
    username = models.CharField("用户名", max_length=128, unique=True, blank=False)
    password = models.CharField("密码", max_length=128, null=False, blank=False)
    create_time = models.DateTimeField("创建时间", auto_now_add=True)

    # TODO 顾客的微信账号登陆信息

    def __str__(self):
        return self.name

    class Meta:
        ordering = ["name"]
        verbose_name = "顾客"
        verbose_name_plural = "顾客"
